<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Call</title>
</head>
<body>
	Call实现
</body>
<script>
    Function.prototype.myCall = function(context) {
        context = context ? Object(context) : window
        context.fn = this
        let args = [...arguments].slice(1)
        let r = context.fn(...args)
        delete context.fn
        return r
    }
	function test(a,b,c) {
		console.log('this', this)
        console.log(a,b,c)
	}
	var obj = {name:12}
	test.myCall(obj, 3, 2, 1)

</script>
</html>